﻿@model Unijovem.UI.Models.EventoModel
@{
    ViewBag.Title = "Editar";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    Editar</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.maskedinput-1.3.min.js")" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $("#Data").mask("99/99/9999");
        $("#Hora").mask("99:99");
    });
</script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>EventoModel</legend>
        @Html.ActionLink("Carregar fotos", "Upload", "Arquivo", new { id = Model.Id, tipo = Unijovem.UI.Models.ArquivoModel.TipoArquivo.Evento }, null)
        @Html.ActionLink("Carregar Materiais de apoio", "Upload", "Arquivo", new { id = Model.Id, tipo = Unijovem.UI.Models.ArquivoModel.TipoArquivo.MaterialApoio }, null)

        <div class="editor-label">
            @Html.LabelFor(model => model.IdCategoria)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.IdCategoria, (SelectList)ViewBag.Categorias)
            @Html.ValidationMessageFor(model => model.IdCategoria)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Titulo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Titulo)
            @Html.ValidationMessageFor(model => model.Titulo)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Descricao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Descricao)
            @Html.ValidationMessageFor(model => model.Descricao)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.SetFlickr)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SetFlickr)
            @Html.ValidationMessageFor(model => model.SetFlickr)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Data)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Data, new { value = Model.Data.ToString("dd/MM/yyyy") })
            @Html.ValidationMessageFor(model => model.Data)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Hora)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Hora, new { value = string.Format("{0:hh\\:mm}", Model.Hora) })
            @Html.ValidationMessageFor(model => model.Hora)
        </div>
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.Id, new { id = "IdExterno" })
        <p>
            <input type="submit" value="Save" />
        </p>
        @Html.Action("ListarEdicaoPartial", "Arquivo", new { idExterno = Model.Id })
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
